<template>
  <div class="ChatSetting">
    <n-space>
      <n-dropdown trigger="click" :options="ObjectToArray<FormTemplatesOption>(chatSettings)?.map((e) => {
        return {
          key: e.key,
          label: e.label
        }
      })" @select="handleSelect">
        <c-button v-if="chatSettings" quaternary iconName="SettingsFilled"></c-button>
      </n-dropdown>
    </n-space>
    <ChatSettingLog ref="log" />
  </div>
</template>

<script setup lang='ts'>
const { getChatSettings } = chatSettingStore()
const chatSettings = getChatSettings()
const log = ref()
const handleSelect = (e: string) => {
  log.value.show(e)
}

</script>
